import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import "amfe-flexible";
import "@/assets/style/main.less";
import env from "@/config/env";
import { filePreview } from "@/utils/tools";
import * as tools from "@/utils/tools";
import { Dialog, Toast } from "vant";
import moment from "moment";
import "@/directives";
import CPromise from "@/utils/cPromise";

Vue.config.productionTip = false;
Vue.prototype.$config = env;
Vue.prototype.$filePreview = filePreview;
Vue.prototype.$tools = tools;
Vue.prototype.$dialog = Dialog;
Vue.prototype.$toast = Toast;
Vue.prototype.$moment = moment;
Vue.prototype.$cPromise = CPromise;

// 需要在按钮元素或body/html上绑定一个touchstart事件才能激活:active状态
document.body.addEventListener("touchstart", function() {
  // undo
});

new Vue({
  router,
  store,
  render: (h) => h(App)
}).$mount("#app");
